package com.xbongbong.pro.domain.entity;

import com.alibaba.fastjson.JSONArray;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 
 * tb_chart_drill
 * 
 * @author bomfish
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
public class ChartDrillEntity implements Serializable {
    private static final long serialVersionUID = 6014855521819801015L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 公司id
     */
    private String corpid;

    /**
     * 指标类型：1系统指标,2自定义指标
     * @see com.xbongbong.pro.statistic.enums.StatisticsTypeEnum
     */
    private Integer statisticsType;

    /**
     * 数据集id
     */
    private Long chartId;

    /**
     * 数组格式：存储整个层级，及各个层级下的可钻取字段信息
     * 可转换为 List<ChartDrillItemPojo>
     */
    private JSONArray drill;

    /**
     * 创建者id
     */
    private String creatorId;

    /**
     * 删除标记
     */
    private Integer del;

    /**
     * 创建时间
     */
    private Long addTime;

    /**
     * 更新时间
     */
    private Long updateTime;

    public ChartDrillEntity(String corpid, Integer statisticsType, Long chartId, JSONArray drill, String creatorId){
        this.corpid = corpid;
        this.statisticsType = statisticsType;
        this.chartId = chartId;
        this.drill = drill;
        this.creatorId = creatorId;
        this.del = 0;
        this.addTime = DateTimeUtil.getInt();
        this.updateTime = DateTimeUtil.getInt();
    }
}